package com.qf.demo.controller;

import com.qf.demo.entity.User;
import com.qf.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService uus;

    @RequestMapping("/success")
    public String test0(){
        return "redirect:/success.html";
    }


    @RequestMapping("/fail")
    public String test1(){
        return "redirect:/fail.html";
    }

    @RequestMapping("/regist")
    public String test2(@RequestBody User uu, HttpServletRequest request){
//        String code=(String)request.getSession().getAttribute("verifyCode");
        uus.insertUser(uu);
        return null;
    }

}
